home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DispTabl.h
-
- Contains: Definition of class DispatchTable, which is private to the implementation of
- ODDispatcher.
-
- Owned by: Richard Rodseth
-
- Copyright: © 1992 - 1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <2> 9/8/95 jpa Use official error number range for private
- error [1281354]
- <1> 5/13/94 RR first checked in
- <9> 2/9/94 NP Tiger Team cleanup.
- <8> 1/15/94 RR WinState.h->WinStat.h,
- Dispatch.h->Disptch.h
- <7> 12/2/93 RR Use new eventType definition
- <6> 8/20/93 RR Fixed array indexing bug
- <5> 8/18/93 RR Added GetDispatchInfo/UpdateDispatchInfo
- <4> 8/18/93 RR Use DictionaryList class
- <2> 8/17/93 RCR Use OrderedCollection instead of linked list, for monitors
- <1> 8/10/93 RCR first checked in
-
- To Do:
- In Progress:
-
- */
-
- #ifndef _DISPTABL_
- #define _DISPTABL_
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- //=====================================================================================
- // Theory of Operation
- //=====================================================================================
-
- /*
- See Disptch.h
-
- Contains an array of dispatch modules for the first 256 event codes. If there are
- any more, they go in an overflow linked list. A Windows implementation might use
- a hash table instead, since there are so many more messages.
-
- */
-
- //=====================================================================================
- // Constants
- //=====================================================================================
-
- const ODEventType kODLastEvent = 255; // Index of last entry in the dispatch table
-
- // Check ErrorDef.idl before adding any new codes here, to make sure they're unique.
- const ODError kODErrDispatcherNotInitialized = -29829;
-
- //=====================================================================================
- // Scalar Types
- //=====================================================================================
-
- //=====================================================================================
- // Classes defined in this interface
- //=====================================================================================
-
- class DispatchTable;
-
- //=====================================================================================
- // Classes used by this interface
- //=====================================================================================
-
- class DispatchInfo;
- class OrderedCollection;
- class DictionaryList;
- class ODDispatchModule;
-
- //=====================================================================================
- // Global Variables
- //=====================================================================================
-
- //=====================================================================================
- // Class DispatchTable
- //=====================================================================================
-
- class DispatchTable
- {
- public:
-
- DispatchTable();
-
- // Constructor
-
- ~DispatchTable();
-
- // Destructor
-
- void AddMonitor(ODEventType eventType,
- ODDispatchModule* dispatchModule);
-
- void RemoveMonitor(ODEventType eventType,ODDispatchModule* dispatchModule);
-
- void AddDispatchModule(ODEventType eventType,
- ODDispatchModule* dispatchModule);
-
- void RemoveDispatchModule(ODEventType eventType);
-
- ODDispatchModule* GetDispatchModule(ODEventType eventType);
-
- OrderedCollection* GetMonitors(ODEventType eventType);
-
- protected:
-
- DispatchInfo* GetDispatchInfo(ODEventType eventType);
- void UpdateDispatchInfo(ODEventType eventType, DispatchInfo* info);
-
- private:
-
- DispatchInfo* fDispatchInfo[kODLastEvent + 1]; // An array for the first 256 event types
- DictionaryList* fOverflowDispatchInfo; // A dictionary for those that don't
- // fit in the array
-
- };
-
- #endif // _DISPTABL_